<template>
	<main-content
		:tableHeight.sync="tableHeight"
		:otherDependenComponents="otherDependenComponents"
	>
		<template slot="query">
			<el-form
				ref="ruleForm"
				:model="queryData"
				label-width="120px"
				label-suffix=":"
				:inline="true"
				class="demo-ruleForm"
			>
				<el-form-item
					:label="`${$t('dxn.game_list.hand_id')}`"
					prop="handCode"
				>
					<el-input
						v-model.trim="queryData.handCode"
						v-input="{ name: 'symbols' }"
						clearable
						style="width: 230px"
						:placeholder="
							`${$t('dxn.game_list.hand_id_placeholder')}`
						"
					></el-input>
				</el-form-item>
				<el-form-item
					:label="`${$t('dxn.card_ables_list.table_id')}`"
					prop="tableCode"
				>
					<el-input
						v-model.trim="queryData.tableCode"
						v-input="{ name: 'symbols' }"
						clearable
						style="width: 230px"
						:placeholder="
							`${$t('dxn.card_ables_list.table_id_placeholder')}`
						"
					></el-input>
				</el-form-item>
				<el-form-item
					:label="`${$t('dxn.card_ables_list.game_name')}`"
					prop="tableTypeList"
				>
					<el-select
						v-model="queryData.tableTypeList"
						clearable
						:placeholder="
							`${$t('dxn.card_ables_list.game_name_placeholder')}`
						"
						multiple
						style="width:220px"
					>
						<el-option
							v-for="item in gameTypes"
							:key="item.code"
							:label="item.description"
							:value="item.code"
						></el-option>
					</el-select>
				</el-form-item>
				<el-form-item>
					<span slot="label">
						盲注:
						<el-popover
							placement="top-start"
							width="auto"
							trigger="hover"
							content="以“大盲值（德州）、前注值（短牌）”查询，包含最小、最大值范围数据"
						>
							<span slot="reference">
								<i class="el-icon-question"></i>
							</span>
						</el-popover>
					</span>
					<el-input
						v-model="queryData.blindScoreMin"
						size="medium"
						:placeholder="$t('common.minimum')"
						style="width: 120px"
						maxLength="15"
						v-input="{ name: 'float', num: '2' }"
						name="blindScoreMin"
						clearable
						@blur="
							handleAmount(
								queryData,
								1,
								'blindScoreMin',
								'blindScoreMax',
								$t('member.check_min_tips')
							)
						"
					></el-input>
					-
					<el-input
						v-model="queryData.blindScoreMax"
						size="medium"
						:placeholder="$t('common.maximum')"
						style="width: 120px"
						maxLength="15"
						v-input="{ name: 'float', num: '2' }"
						name="blindScoreMax"
						clearable
						@blur="
							handleAmount(
								queryData,
								2,
								'blindScoreMin',
								'blindScoreMax',
								$t('member.check_max_tips')
							)
						"
					></el-input>
				</el-form-item>
				<el-form-item label="有效底池范围" label-width="120px">
					<el-input
						v-model="queryData.validPotMin"
						size="medium"
						:placeholder="$t('common.minimum')"
						style="width: 120px"
						maxLength="15"
						v-input="{ name: 'float', num: '2' }"
						name="validPotMin"
						clearable
						@blur="
							handleAmount(
								queryData,
								1,
								'validPotMin',
								'validPotMax',
								$t('member.check_min_tips')
							)
						"
					></el-input>
					-
					<el-input
						v-model="queryData.validPotMax"
						size="medium"
						:placeholder="$t('common.maximum')"
						style="width: 120px"
						maxLength="15"
						v-input="{ name: 'float', num: '2' }"
						name="validPotMax"
						clearable
						@blur="
							handleAmount(
								queryData,
								2,
								'validPotMin',
								'validPotMax',
								$t('member.check_max_tips')
							)
						"
					></el-input>
				</el-form-item>
				<el-form-item
					:label="`${$t('dxn.card_ables_list.handle_start_time')}`"
					prop="dateTime"
				>
					<el-date-picker
						v-model="queryData.dateTime"
						type="datetimerange"
						range-separator="-"
						:start-placeholder="
							$t('dxn.card_ables_list.start_time')
						"
						:end-placeholder="$t('dxn.card_ables_list.end_time')"
						format="yyyy-MM-dd HH:mm:ss"
						:picker-options="pickerShortcut2"
						:default-time="defaultTime"
						value-format="timestamp"
						align="right"
						style="width: 360px"
					></el-date-picker>
				</el-form-item>
				<el-form-item label="手牌输赢范围" label-width="120px">
					<el-input
						v-model="queryData.handNetAmountMin"
						size="medium"
						:placeholder="$t('common.minimum')"
						style="width: 120px"
						maxLength="15"
						v-input="{ name: 'onlyTwoNum' }"
						name="handNetAmountMin"
						clearable
						@blur="
							handleAmount(
								queryData,
								1,
								'handNetAmountMin',
								'handNetAmountMax',
								$t('member.check_min_tips')
							)
						"
					></el-input>
					-

					<el-input
						v-model="queryData.handNetAmountMax"
						size="medium"
						:placeholder="$t('common.maximum')"
						style="width: 120px"
						maxLength="15"
						v-input="{ name: 'onlyTwoNum' }"
						name="handNetAmountMax"
						clearable
						@blur="
							handleAmount(
								queryData,
								2,
								'handNetAmountMin',
								'handNetAmountMax',
								$t('member.check_max_tips')
							)
						"
					></el-input>
				</el-form-item>
				<el-form-item
					:label="`牌型`"
					label-width="60px"
					prop="resultInfoList"
				>
					<el-select
						v-model="queryData.resultInfoList"
						clearable
						:placeholder="
							`${$t('dxn.card_ables_list.game_name_placeholder')}`
						"
						multiple
						style="width:240px"
					>
						<el-option
							v-for="item in cardTypeArr"
							:key="item.description"
							:label="item.description"
							:value="item.description"
						></el-option>
					</el-select>
				</el-form-item>
				<el-form-item
					:label="`牌桌所属俱乐部ID`"
					prop="clubId"
					label-width="135px"
				>
					<el-input
						v-model.trim="queryData.clubId"
						v-input="{ name: 'num' }"
						clearable
						style="width: 160px"
						:placeholder="`${$t('common.please_enter')}`"
					></el-input>
				</el-form-item>
				<el-form-item label="会员账号">
					<el-input
						v-model.trim="queryData.userName"
						v-input="{ name: 'noEmpty' }"
						clearable
						style="width: 210px"
						:placeholder="$t('common.please_enter')"
					></el-input>
				</el-form-item>
				<el-form-item
					:label="`会员所属俱乐部ID`"
					prop="userClubId"
					label-width="135px"
				>
					<el-input
						v-model.trim="queryData.userClubId"
						v-input="{ name: 'num' }"
						clearable
						style="width: 160px"
						:placeholder="`${$t('common.please_enter')}`"
					></el-input>
				</el-form-item>
				<el-form-item>
					<el-button
						type="primary"
						size="medium"
						icon="el-icon-search"
						:disabled="disabledSearch"
						:loading="disabledSearch"
						@click="handleSearch"
					>
						{{ $t('dxn.card_ables_list.search') }}
					</el-button>
					<el-button
						size="medium"
						icon="el-icon-refresh-right"
						@click="reset"
					>
						{{ $t('dxn.card_ables_list.reset') }}
					</el-button>
					<el-button
						v-if="hasPermission('90870056')"
						type="warning"
						size="medium"
						icon="el-icon-download"
						:loading="exportBtnLoading"
						@click="exportExcel"
					>
						{{ $t('dxn.card_ables_list.export_excel') }}
					</el-button>
					<el-button
						v-if="hasPermission('90870092')"
						type="success"
						icon="el-icon-sort"
						size="medium"
						@click="showColumnSet"
					>
						{{ $t('common.row_set') }}
					</el-button>
				</el-form-item>
			</el-form>
		</template>
		<template slot="content">
			<el-table
				ref="refTable"
				v-loading="loading"
				element-loading-spinner="el-icon-loading"
				@current-change="handleSelectRowHighlight"
				size="mini"
				class="small-size-table"
				border
				:data="list"
				style="width: 100%"
				:max-height="tableHeight"
				:header-cell-style="getRowClass"
				highlight-current-row
				header-align="center"
				@sort-change="handleTableSort"
				show-summary
				:summary-method="
					(val) => handleRow(val, subSummary, totalSummary)
				"
			>
				<el-table-column
					type="index"
					:label="`序号`"
					width="120"
					align="center"
				/>
				<el-table-column
					:label="`会员账号`"
					min-width="120"
					align="center"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.userName || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					:label="`会员昵称`"
					min-width="120"
					align="center"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.nickName || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.userClubId]"
					label="会员所属俱乐部ID"
					min-width="125"
					align="center"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<div
							v-if="scope.row.userClubId"
							class="text-link"
							@click="
								$router.push({
									path: '/dxn/clubManager/clubList',
									query: {
										clubId: scope.row.userClubId
									}
								})
							"
						>
							{{ scope.row.userClubId }}
						</div>
						<div v-else>-</div>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.handCode]"
					:label="`手牌ID`"
					min-width="190"
					align="center"
				>
					<template slot-scope="scope">
						<div
							v-if="scope.row.handCode"
							class="blueColor decoration"
							@click="
								handleJump({
									path: '/dxn/gameManager/gameList/gameBase',
									query: {
										handId: scope.row.handCode
									}
								})
							"
						>
							{{ scope.row.handCode }}
						</div>
						<div v-else>-</div>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.handStatus]"
					:label="`状态`"
					min-width="100"
					align="center"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ statesMap[scope.row.handStatus] || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.handNum]"
					:label="`手牌号`"
					min-width="80"
					align="center"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.handNum || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.handBeginTime]"
					:label="`手牌开始时间`"
					min-width="160"
					align="center"
					show-overflow-tooltip
					prop="handBeginTime"
					sortable="custom"
				>
					<template slot-scope="scope">
						{{ scope.row.handBeginTime || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.handEndTime]"
					:label="`手牌结束时间`"
					min-width="160"
					align="center"
					show-overflow-tooltip
					prop="handEndTime"
					sortable="custom"
				>
					<template slot-scope="scope">
						{{ scope.row.handEndTime || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.tableCode]"
					:label="`牌桌ID`"
					min-width="180"
					align="center"
				>
					<template slot-scope="scope">
						<div
							v-if="scope.row.tableCode"
							class="blueColor decoration"
							@click="
								handleJump({
									path:
										'/dxn/gameManager/cardTablesList/cardTablesBase',
									query: {
										tableId: scope.row.tableCode
									}
								})
							"
						>
							{{ scope.row.tableCode }}
						</div>
						<div v-else>-</div>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.tableName]"
					:label="`牌桌名称`"
					min-width="200"
					align="center"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						{{ scope.row.tableName || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.tableType]"
					:label="`游戏名称`"
					min-width="100"
					align="center"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<!-- {{ scope.row.gameName || '-' }} -->
						{{ typeFilter(scope.row.tableType, 'gameType') }}
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.bbBlindScore]"
					:label="`盲注`"
					min-width="120"
					align="center"
					prop="bbBlindScore"
					sortable="custom"
				>
					<template slot-scope="scope">
						<ShowBlindInjection
							:tableType="scope.row.tableType"
							:bbBlindScore="scope.row.bbBlindScore"
							:sbBlindScore="scope.row.sbBlindScore"
							:anteSwitch="scope.row.anteSwitch"
							:anteScore="scope.row.anteScore"
							:straddleAmount="scope.row.straddleAmount"
						/>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.clubId]"
					:label="`牌桌所属俱乐部ID`"
					min-width="125"
					align="center"
				>
					<template slot-scope="scope">
						<div
							v-if="scope.row.clubId"
							class="blueColor decoration"
							@click="
								handleJump({
									path: '/dxn/clubManager/clubList',
									query: {
										clubId: scope.row.clubId
									}
								})
							"
						>
							{{ scope.row.clubId }}
						</div>
						<div v-else>-</div>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.handNetAmount]"
					:label="`会员手牌输赢`"
					min-width="150"
					align="center"
					show-overflow-tooltip
					prop="handNetAmount"
					sortable="custom"
				>
					<template slot-scope="scope">
						<span
							:style="handleNumberColor(scope.row.handNetAmount)"
						>
							{{
								handleNumber(
									scope.row.currency,
									scope.row.handNetAmount
								)
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.beginAmount]"
					:label="`初期金额汇总`"
					min-width="150"
					align="center"
					show-overflow-tooltip
					prop="beginAmount"
					sortable="custom"
				>
					<template slot-scope="scope">
						<span>
							{{
								handleNumber(
									scope.row.currency,
									scope.row.beginAmount
								)
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.bringMidwayAmount]"
					:label="`中途带入金额汇总`"
					min-width="150"
					align="center"
					show-overflow-tooltip
					prop="bringMidwayAmount"
					sortable="custom"
				>
					<template slot-scope="scope">
						<span>
							{{
								handleNumber(
									scope.row.currency,
									scope.row.bringMidwayAmount
								)
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.endAmount]"
					:label="`末期余额汇总`"
					min-width="150"
					align="center"
					show-overflow-tooltip
					prop="endAmount"
					sortable="custom"
				>
					<template slot-scope="scope">
						<span>
							{{
								handleNumber(
									scope.row.currency,
									scope.row.endAmount
								)
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.validPot]"
					:label="`有效底池`"
					min-width="150"
					align="center"
					show-overflow-tooltip
					prop="validPot"
					sortable="custom"
				>
					<template slot-scope="scope">
						<span>
							{{
								handleNumber(
									scope.row.currency,
									scope.row.validPot
								)
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.userHandFee]"
					:label="`手牌服务费`"
					min-width="150"
					align="center"
					show-overflow-tooltip
					prop="userHandFee"
					sortable="custom"
				>
					<template slot-scope="scope">
						<span>
							{{
								handleNumber(
									scope.row.currency,
									scope.row.userHandFee
								)
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.insuredNetAmount]"
					label="经典保险输赢"
					min-width="150"
					align="center"
					show-overflow-tooltip
					prop="insuredNetAmount"
					sortable="custom"
				>
					<template slot-scope="scope">
						<span
							:style="
								handleNumberColor(scope.row.insuredNetAmount)
							"
						>
							{{
								handleNumber(
									scope.row.currency,
									scope.row.insuredNetAmount
								)
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.evInsuredNetAmount]"
					label="EV保险输赢"
					min-width="150"
					align="center"
					show-overflow-tooltip
					prop="evInsuredNetAmount"
					sortable="custom"
				>
					<template slot-scope="scope">
						<span
							:style="
								handleNumberColor(scope.row.evInsuredNetAmount)
							"
						>
							{{
								handleNumber(
									scope.row.currency,
									scope.row.evInsuredNetAmount
								)
							}}
						</span>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.handCards]"
					:label="`会员手牌`"
					min-width="170"
					align="center"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<template
							v-if="
								!scope.row.handInfo ||
									scope.row.handInfo === '[]'
							"
						>
							-
						</template>
						<template v-else>
							<span
								v-for="(item, index) in getCardsImage(
									scope.row.handInfo
								)"
								:key="index"
							>
								<el-image
									class="hand-card-img"
									:class="{ 'hand-card-space': index === 3 }"
									:src="item"
									fit="contain"
								></el-image>
							</span>
						</template>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.publicCards]"
					:label="`公牌信息`"
					min-width="170"
					align="center"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<template
							v-if="
								!scope.row.publicCards ||
									scope.row.publicCards === '[]'
							"
						>
							-
						</template>
						<template v-else>
							<span
								v-for="(item, index) in getCardsImage(
									scope.row.publicCards
								)"
								:key="index"
							>
								<el-image
									class="hand-card-img"
									:class="{ 'hand-card-space': index === 3 }"
									:src="item"
									fit="contain"
								></el-image>
							</span>
						</template>
					</template>
				</el-table-column>
				<el-table-column
					v-if="tableColumnData[tableColumns.cardType]"
					:label="`牌型`"
					min-width="120"
					align="center"
					show-overflow-tooltip
				>
					<template slot-scope="scope">
						<!-- {{ getCardTypeName(scope.row.resultInfo) }} -->
						{{ scope.row.resultInfo || '-' }}
					</template>
				</el-table-column>
				<el-table-column
					fixed="right"
					:label="`${$t('dxn.card_ables_list.operate')}`"
					min-width="270"
					align="center"
				>
					<template slot-scope="scope">
						<span
							class="text-link"
							@click="
								handleJump({
									path: '/dxn/gameManager/gameList/gameBase',
									query: {
										handId: scope.row.handCode
									}
								})
							"
						>
							手牌详情
						</span>
						<span
							class="text-link ml15"
							@click="
								handleJump({
									path: '/dxn/insureManager/insureList',
									query: {
										handId: scope.row.handCode
									}
								})
							"
						>
							保险详情
						</span>
						<span
							class="text-link ml15"
							@click="handleGameReplay(scope.row)"
						>
							牌局回顾
						</span>
					</template>
				</el-table-column>
			</el-table>
			<el-pagination
				v-show="!!total"
				class="pageValue"
				:current-page.sync="pageNum"
				background
				layout="total, sizes,prev, pager, next, jumper"
				:page-size="pageSize"
				:page-sizes="$store.getters.pageSizes"
				:total="total"
				:pager-count="9"
				@current-change="handleCurrentChange"
				@size-change="handleSizeChange"
			></el-pagination>
			<GameReplay
				:dialogVisible.sync="gameReplay.visible"
				:dialogLoading="gameReplay.loading"
				:replayDetail="gameReplay.replayDetail"
				:replayList="gameReplay.replayList"
				:replayReqResult="gameReplay.replayReqResult"
			/>
		</template>
		<TableColumnSet
			v-if="colSettings.visible"
			:visible.sync="colSettings.visible"
			:dialogColumnData="dialogColumnData"
			:activityListField="activityListField"
			@submitColumnSet="submitColumnSet"
			@choiceColumnSet="choiceColumnSet"
		></TableColumnSet>
	</main-content>
</template>

<script>
import { routerNames } from '@/utils/consts'
import dayjs from 'dayjs'
import list from '@/mixins/list'
import { getGameReplayDetail, getCardsImgArr } from '@/utils/replay'
import summaryList from './components/summaryList'
import GameReplay from '@/components/GameReplay'
import ShowBlindInjection from '@/components/Dxn/ShowBlindInjection'
import tableScroll from '@/utils/tableScroll'
import MainContent from '@/components/MainContent/index.vue'
import { tableColumns } from './components/tableColumn'
import TableColumnSet from '@/components/Dxn/TableColumnSet'
import dxnMixin from '@/mixins/dxnMixin'
import { cardTypeArr } from '@/dict/dxn'
const start = () =>
	dayjs()
		.startOf('day')
		.subtract(6, 'day')
const end = () => dayjs().endOf('day')
export default {
	name: routerNames.memberHandCardList,
	components: {
		TableColumnSet,
		MainContent,
		GameReplay,
		ShowBlindInjection
	},
	mixins: [list, summaryList, tableScroll, dxnMixin],
	data() {
		return {
			disabledSearch: false,
			exportBtnLoading: false,
			tableHeight: 480,
			otherDependenComponents: [],
			queryData: {
				handId: '',
				tableId: '',
				handCode: '',
				tableCode: '',
				tableTypeList: [],
				clubId: '',
				userClubId: '',
				orderNo: '',
				resultInfoList: [],
				blindScoreMin: undefined,
				blindScoreMax: undefined,
				handNetAmountMin: undefined,
				handNetAmountMax: undefined,
				validPotMin: undefined,
				validPotMax: undefined,
				dateTime: [start(), end()]
			},
			gameList: [],
			subSummary: {},
			totalSummary: {},
			statesMap: {
				0: '进行中',
				1: '已结束',
				2: '异常局'
			},
			handStatus: 0,
			replayQuery: {
				roundNo: 0, // 手牌num
				tableId: 0 // 牌桌Id
			},
			gameReplay: {
				visible: false, // 回放弹窗可见
				loading: false, // 回放加载
				replayDetail: {}, // 回放详情
				replayList: [], // 回放列表
				replayReqResult: '' // 回放接口数据请求结果
			},
			cardTypeArr,
			tableColumns
		}
	},
	computed: {
		gameTypes() {
			return this.globalDics.gameType || []
		}
	},
	created() {
		this.initIndexDB('memberHandCardList', this.activityListField)
		// this.getDxnGameManagerList()
	},
	methods: {
		getCardTypeName(val) {
			return (
				this.cardTypeArr.find((item) => item.code === val)
					?.description || '-'
			)
		},
		// 获取游戏列表
		getDxnGameManagerList() {
			// this.$api
			// 	.getDxnGameManagerListBend()
			// 	.then((res) => {
			// 		this.gameList = res.data.gameConfigList || []
			// 	})
			// 	.catch((e) => {
			// 		console.error(e)
			// 	})
		},
		// 获取当前参数
		getCurrentParams() {
			const [startTime, endTime] = this.queryData.dateTime || []
			const params = {
				...this.queryData,
				handBeginTimeFrom: startTime
					? dayjs(startTime).format('YYYY-MM-DD HH:mm:ss')
					: undefined,
				handBeginTimeTo: endTime
					? dayjs(endTime).format('YYYY-MM-DD HH:mm:ss')
					: undefined
			}
			if (!params.tableTypeList?.length) {
				params.tableTypeList = undefined
			}
			if (!params.resultInfoList?.length) {
				params.resultInfoList = undefined
			}
			delete params.dateTime
			return params
		},
		// 加载数据
		loadData() {
			const params = this.getParams(this.getCurrentParams())
			this.loading = true
			this.disabledSearch = true
			this.list = []
			this.subSummary = {}
			this.totalSummary = {}
			this.$api
				.getMemberHandCardListBend(params)
				.then((res) => {
					this.loading = false
					this.disabledSearch = false
					const { record = [], totalRecord, summary = [] } =
						res.data || {}
					this.list = record
					this.total = totalRecord || 0
					this.subSummary = summary[0] || {}
					this.totalSummary = summary[1] || {}
				})
				.catch(() => {
					this.loading = false
					this.disabledSearch = false
				})
		},
		// 跳转到牌局回放
		handleGameReplay(row) {
			this.handStatus = row?.handStatus
			this.replayQuery = {
				tableId: row.tableId,
				roundNo: row.handNum
			}
			this.gameReplay = {
				visible: true,
				loading: true,
				replayDetail: {
					info: {
						handId: ''
					},
					handStatus: undefined
				},
				replayList: [],
				replayReqResult: ''
			}
			if (row.handStatus === 0) {
				this.gameReplay.replayDetail.info.handId = row.handCode
				this.gameReplay.replayReqResult = '没有记录'
				this.gameReplay.loading = false
				return false
			}
			getGameReplayDetail(this)
				.then((ret) => {
					this.gameReplay.replayDetail = ret.replayDetail
					this.gameReplay.replayList = ret.replayList
				})
				.catch((ret) => {
					this.gameReplay.replayReqResult = ret.message
				})
				.finally(() => {
					this.gameReplay.replayDetail.info.handId = row.handCode
					this.gameReplay.replayDetail.handStatus = row.handStatus
					this.gameReplay.loading = false
				})
		},
		// 搜索
		handleSearch() {
			this.clearTableSort()
			this.pageNum = 1
			this.loadData()
		},
		// 重置
		reset() {
			this.resetQueryData()
			this.pageNum = 1
			// this.$refs.ruleForm.resetFields()
			this.queryData.dateTime = [start(), end()]
			this.loadData()
		},
		// 导出
		exportExcel() {
			const params = this.getParams(this.getCurrentParams())
			this.deleteExportParams(params)
			this.exportBtnLoading = true
			this.exportExcelPublic({
				api: 'exportMemberHandCardListBend',
				params
			}).finally(() => {
				this.exportBtnLoading = false
			})
		},
		getCardsImage(cardsStr) {
			let imageArr = []
			const cardsNumReplaceStr = cardsStr.replace(/[\[\]]/g, '')
			if (cardsNumReplaceStr) {
				imageArr = getCardsImgArr(cardsNumReplaceStr.split(','))
			}
			return imageArr
		},
		handleJump(obj) {
			this.$router.push(obj)
		}
	}
}
</script>

<style lang="scss" scoped>
.decoration {
	text-decoration: underline;
	cursor: pointer;
}
::v-deep .footer_count_row {
	min-height: 50px;
	height: 50%;
	display: flex;
	font-weight: 700;
	padding: 5px 0;
	align-items: center;
	flex-direction: column;
	justify-content: center;
}
::v-deep .footer_count_row_border {
	border-top: 1px solid #ebeef5;
}
.arrowStyel {
	display: flex;
	justify-content: space-between;
	margin-bottom: 15px;
}
.hand-card-img {
	width: 27px;
	height: 36px;
}
.hand-card-space {
	margin-left: 5px;
}
::v-deep .el-icon-question:after {
	font-size: 14px;
	margin-left: -2px;
}
</style>
